package cn.sstir.hackathon.core;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 导出字段映射抽象类
 *
 * @author: fli
 * @email: fli@sstir.cn
 * @date: 2019/12/11 15:10
 */
public abstract class AbstractExportMap {

    protected Map<String,String> dictory = new LinkedHashMap<>();
    protected Map<String,Map<String,String>> fieldCollectionDictory = new LinkedHashMap<>();

    public AbstractExportMap() {
        initFieldMap();
        initFieldCollectionMap();
    }

    public Map<String, String> getDictory() {
        return dictory;
    }

    public Map<String, Map<String, String>> getFieldCollectionDictory() {
        return fieldCollectionDictory;
    }

    /**
     * 列名
     *
     * @author fli
     * @date 2019/12/11 15:14
     */
    public abstract void initFieldMap();

    /**
     * 一对多字段
     */
    public abstract void initFieldCollectionMap();


    public String get(String key) {
        return this.dictory.get(key);
    }

    public void put(String key, String value) {
        this.dictory.put(key, value);
    }


    public Map<String, String> getCollectionFieldMap(String key) {
        return this.fieldCollectionDictory.get(key);
    }

    public void putCollectionFieldMap(String key, Map<String,String> map) {
        this.fieldCollectionDictory.put(key, map);
    }
}
